Use case: DMA channel linear linked-list mode transfer in polling mode ¶
Note
To perform a DMA linked-list transfer, follow these steps:
First, fill the desired nodes with the required configuration.
Next, create a queue using these filled nodes.
Finally, start the transfer using the built queue.
Sequence diagram ¶
Code snippet ¶
|
HAL1 |
HAL2 |
|---|---|
HAL_DMAEx_List_BuildNode(&NodeConf, &Node1);
HAL_DMAEx_List_InsertNode(&Queue1, NULL, &Node1);
HAL_DMAEx_List_Init(&LL_HandleDMA1);
HAL_DMAEx_List_LinkQ(&LL_HandleDMA1, &Queue1);
HAL_DMAEx_List_Start(&LL_HandleDMA1)
HAL_DMA_PollForTransfer(&hdma_F, HAL_DMA_FULL_TRANSFER, timeout);
|
HAL_DMA_FillNodeConfig(Node1, NodeConf, HAL_DMA_NODE_2D_ADDRESSING);
HAL_Q_Init(Queue2, &HAL_DMA_2DAddressing_DescOps);
HAL_Q_InsertNode(Queue2, NULL, Node1);
HAL_DMA_Init(LL_DMA_Handle1, HAL_GPDMA1_CH12);
HAL_DMA_SetConfigLinkedListXfer(LL_DMA_Handle1, LL_xfer_config1);
HAL_DMA_StartLinkedListXfer(&hdma, srcAddress, dstAddress, dataSize * multiplier);
HAL_DMA_PollForXfer(&hdma, HAL_DMA_XFER_FULL_COMPLETE, timeout);
|
Key changes ¶
HAL2 introduces a queue-based approach using
HAL_Q_*services for linked-list transfers.HAL2 configures linked-list transfers using
HAL_DMA_SetConfigLinkedListXfer()and starts them usingHAL_DMA_StartLinkedListXfer().HAL2 uses
HAL_DMA_PollForXfer()for polling completion.

